<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="${serviceTargetNamespace}" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:esb="${wsdlLocation}" name="${name}" targetNamespace="${serviceTargetNamespace}">
    <wsdl:types>
        <xsd:schema elementFormDefault="qualified" targetNamespace="${wsdlLocation}">
            <xsd:element name="RouteInformation">
                <xsd:complexType>
                    <xsd:sequence>
                    <#list requestDataGateway  as key>
                        <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                    </#list>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
        <xsd:schema elementFormDefault="qualified" targetNamespace="${serviceTargetNamespace}">
            <xsd:element name="${method}">
                <xsd:annotation>
                    <xsd:documentation>${documentation}</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:sequence>

                        <#if reqSysHead??>
                        <xsd:element name="sysHead" minOccurs="1" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence></#if>
                                    <#list requestDataSysHead  as key>
                                        <#if key.type=='level_label_start'||key.type=='list_start'>
                                    <xsd:element name="${key.name}" <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if>>
                                        <xsd:complexType>
                                            <xsd:sequence><#elseif key.type=='level_label_end'||key.type=='list_end'>
                                            </xsd:sequence>
                                        </xsd:complexType>
                                    </xsd:element><#else>
                                        <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                                        </#if>
                                    </#list>
                        <#if reqSysHead??>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element></#if>


                        <#if reqBusHead??>
                        <xsd:element name="busHead" minOccurs="1" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence></#if>
                                    <#list requestDataBusHead  as key>
                                        <#if key.type=='level_label_start'||key.type=='list_start'>
                                        <xsd:element name="${key.name}" <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if>>
                                            <xsd:complexType>
                                            <xsd:sequence><#elseif key.type=='level_label_end'||key.type=='list_end'>
                                            </xsd:sequence>
                                            </xsd:complexType>
                                            </xsd:element><#else>
                                            <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                                        </#if>
                                    </#list>
                                    <#if reqBusHead??>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element></#if>

                        <#if reqBody??>
                        <xsd:element name="body" minOccurs="1" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence></#if>
                                    <#list requestDataBody  as key>
                                        <#if key.type=='level_label_start'||key.type=='list_start'>
                                        <xsd:element name="${key.name}" <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if>>
                                            <xsd:complexType>
                                            <xsd:sequence><#elseif key.type=='level_label_end'||key.type=='list_end'>
                                            </xsd:sequence>
                                            </xsd:complexType>
                                            </xsd:element><#else>
                                            <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                                        </#if>
                                    </#list>
                                    <#if reqBody??>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element></#if>


                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="${method}Response">
                <xsd:annotation>
                    <xsd:documentation>${documentation}</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:sequence>

                        <#if respSysHead??>
                        <xsd:element name="sysHead" minOccurs="1" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence></#if>
                                    <#list responseDataSysHead  as key>
                                        <#if key.type=='level_label_start'||key.type=='list_start'>
                                        <xsd:element name="${key.name}" <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if>>
                                            <xsd:complexType>
                                            <xsd:sequence><#elseif key.type=='level_label_end'||key.type=='list_end'>
                                            </xsd:sequence>
                                            </xsd:complexType>
                                            </xsd:element><#else>
                                            <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                                        </#if>
                                    </#list>
                                    <#if respSysHead??>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element></#if>


                        <#if respBusHead??>
                        <xsd:element name="busHead" minOccurs="1" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence></#if>
                                    <#list responseDataBusHead  as key>
                                        <#if key.type=='level_label_start'||key.type=='list_start'>
                                        <xsd:element name="${key.name}" <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if>>
                                            <xsd:complexType>
                                            <xsd:sequence><#elseif key.type=='level_label_end'||key.type=='list_end'>
                                            </xsd:sequence>
                                            </xsd:complexType>
                                            </xsd:element><#else>
                                            <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                                        </#if>
                                    </#list>
                                    <#if respBusHead??>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element></#if>

                        <#if respBody??>
                        <xsd:element name="body" minOccurs="1" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence></#if>
                                    <#list responseDataBody  as key>
                                        <#if key.type=='level_label_start'||key.type=='list_start'>
                                        <xsd:element name="${key.name}" <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if>>
                                            <xsd:complexType>
                                            <xsd:sequence><#elseif key.type=='level_label_end'||key.type=='list_end'>
                                            </xsd:sequence>
                                            </xsd:complexType>
                                            </xsd:element><#else>
                                            <xsd:element name="${key.name}" <#if key.type??>type="xsd:${key.type}"</#if> <#if key.minOccurs??>minOccurs="${key.minOccurs}"</#if> <#if key.maxOccurs??>maxOccurs="${key.maxOccurs}"</#if> />
                                        </#if>
                                    </#list>
                                    <#if respBody??>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element></#if>

                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="RouteInformation">
        <wsdl:part element="esb:RouteInformation" name="RouteInfo"/>
    </wsdl:message>
    <wsdl:message name="${method}Request">
        <wsdl:part element="tns:${method}" name="${method}"/>
    </wsdl:message>
    <wsdl:message name="${method}Response">
        <wsdl:part element="tns:${method}Response" name="${method}Response"/>
    </wsdl:message>
    <wsdl:portType name="${name}">
        <wsdl:operation name="${method}">
            <wsdl:documentation>${documentation}</wsdl:documentation>
            <wsdl:input message="tns:${method}Request"/>
            <wsdl:output message="tns:${method}Response"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="${name}SOAP" type="tns:${name}">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="${method}">
            <wsdl:documentation>${documentation}</wsdl:documentation>
            <soap:operation soapAction="${serviceTargetNamespace}/${method}"/>
            <wsdl:input>
                <soap:header message="tns:RouteInformation" part="RouteInfo" use="literal"/>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:header message="tns:RouteInformation" part="RouteInfo" use="literal"/>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="${name}">
        <wsdl:port binding="tns:${name}SOAP" name="${name}SOAP">
            <soap:address location="${address}"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
